package com.ruan.controller;

import com.ruan.pojo.Role;
import com.ruan.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName:RoleController
 * @Author:阮昇
 * @Description:
 * @Datetime: 2023/6/14 15:25
 **/
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @RequestMapping("/getRoleById/{id}")
    public Role getRoleById(@PathVariable Integer id){
        return roleService.getRoleById(id);
    }

    @RequestMapping("/getRoleList")
    public List<Role> getRoleList(){
        return roleService.getRoleList();
    }
}

